package 比较器;
//1.
public class Student implements Comparable<比较接口.Student>{
    public String name;
    public int age;
    public double score;

    public Student(String name, int age, double score) {
        this.name = name;
        this.age = age;
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", score=" + score +
                '}';
    }

    //重写compareTo-Generate-implement
    @Override
    public int compareTo(比较接口.Student o) {
        return this.age-o.age;
    }
}
